<?php
namespace app\home\validate;
 
use think\Validate;

 
class User extends Validate{
    protected $rule = [
        'name'  => 'require|max:10',
        'pass'  => 'require',
        'email' => 'require|email',
        // 'tel'    => 'require|length:11|number|match:',
        // ['tel', 'require|[#^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$#]', '请输入用户名|请输入正确的手机号'],
         ['tel','require|length:11|/^1[34578]\d{9}$/','手机号码必填|手机号码必须为11位，请检查。|您输入的手机号码有问题，请检查。'],
         'pass' => 'require|confirm|min:6|max:15',
    
    ];
 
    protected $message  =   [
        'name.require' => '名称必须',
        'name.max'     => '名称最多不能超过10个字符',
        'tel.number'   => '手机必须是数字',
        'pass.require' => '密码必须',
        'pass.min' => '密码至少6位',
        'pass.max' => '密码不超过15位',
        'pass.confirm' => '两次密码不一致',
        'email.require' => '邮箱必须',
        'email'        => '邮箱格式错误',
    ];


 
}
